

#include "PCF8575Driver.h"
#include "i2cDriver.h"



void initExpander(void)
{
	i2cInit();
}


void readIOExpander(unsigned char * exPort0, unsigned char * exPort1)
{
		i2cStart();
		i2cWrite(EXADD_R);	// address the expander	
		
		*exPort0 = i2cRead(1);
		*exPort1 = i2cRead(0);		

		i2cStop();
}

void writeIOExpander(unsigned char exPort0, unsigned char exPort1)
{
		i2cStart(); // Transmitt the start condition
		i2cWrite(EXADD_W); // Address the gpio expander

		i2cWrite(exPort0);
		i2cWrite(exPort1);

		i2cStop();
}

